<?php

namespace Acme\StaffBundle\Form;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilder;

class StaffForm extends AbstractType {
    
    public function buildForm(FormBuilder $builder, array $options) {
        $builder->add('name', 'text', array('required'=>true));
        $builder->add('description', 'textarea', array('required'=>false));
        $builder->add('category', 'entity', array('class' => 'AcmeStaffBundle:CategoryStaff'));
        $builder->add('file');
        $subscribe = new EventListener\EditCategoryEventListener($builder->getFormFactory());
        $builder->addEventSubscriber($subscribe);
    }

    public function getDefaultOptions(array $options) {
        return array(
            'data_class'      => 'Acme\StaffBundle\Entity\Staff',

        );
    }
    
    public function getName() {
        return 'Staff';
    }
}

?>
